package com.jane.adapter.homepageadapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentStatePagerAdapter;

import com.jane.bean.SeorinityTabLayoutData;

import java.util.List;

/**
 * Created by Administrator on 2016/11/15.
 */

public class TitleFragmentPagerAdapter extends FragmentStatePagerAdapter {

    private List<Fragment> mFragments;
    private List<SeorinityTabLayoutData.AllGameBean> mTitles;

    public TitleFragmentPagerAdapter(FragmentManager fm, List<SeorinityTabLayoutData.AllGameBean> mTitles, List<Fragment> fragments) {
        super(fm);
        this.mTitles = mTitles;
        this.mFragments = fragments;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragments.get(position);
    }

    @Override
    public int getCount() {
        return mFragments == null ? 0 : mFragments.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitles.get(position).getName();
    }
}
